package com.dwj.auto.comment.config.mybatis.plus;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

public class CommonServiceImpl<M extends CommonMapper<T>, T> extends ServiceImpl<M, T> {

    public <E> IPage<E> voPage(QueryCriteria<T,E> criteria) {
        return baseMapper.voPage(new Page<>(criteria.getPage(), criteria.getLimit()), criteria.simpleWrapper());
    }

    public <E> IPage<E> voPage(QueryCriteria<T,E> criteria, Wrapper<T> wrapper) {
        return baseMapper.voPage(new Page<>(criteria.getPage(), criteria.getLimit()), wrapper);
    }
}
